import request from "@/utils/request"

//添加课程
export function addCourseInfo(courseInfo) {
  return request({
    url: `/eduService/edu-course/addCourseInfo`,
    method: 'post',
    data: courseInfo
  })
}

//根据id获取课程信息
export function getCourseInfo(courseId) {
  return request({
    url: `/eduService/edu-course/getCourseInfo/${courseId}`,
    method: 'get'
  })
}

//修改课程信息
export function updateCourseInfo(courseInfo) {
  return request({
    url: `/eduService/edu-course/updateCourseInfo`,
    method: 'post',
    data: courseInfo
  })
}

//根据课程id查询课程信息（信息确认）
export function getCoursePublishInfo(courseId) {
  return request({
    url: `/eduService/edu-course/getCoursePublishInfo/${courseId}`,
    method: 'get'
  })
}

//发布课程
export function publishCourse(courseId) {
  return request({
    url: `/eduService/edu-course/publishCourse/${courseId}`,
    method: 'post'
  })
}
//多条件查询课程
export function getCourseListPage(page, limit, courseQuery) {
  return request({
    url: `/eduService/edu-course/pageCourseCondition/${page}/${limit}`,
    method: 'post',
    data: courseQuery,
  })
}

//删除课程信息
export function removeCourse(courseId) {
  return request({
    url: `/eduService/edu-course/deleteCourse/` + courseId,
    method: 'delete',
  })
}


